//
//  HDEasterEggsTableViewCell.m
//  HDLoan
//
//  Created by ltl on 15/9/6.
//  Copyright (c) 2015年 zlycare. All rights reserved.
//

#import "HDEasterEggsTableViewCell.h"

@interface HDEasterEggsTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *cellTitle;

@property (weak, nonatomic) IBOutlet UILabel *cellSwitchDescripition;

@property (weak, nonatomic) IBOutlet UISwitch *cellSwitch;
@end

@implementation HDEasterEggsTableViewCell

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}

- (void)setCellModel:(HDEETableCellModel *)model {
    self.cellTitle.text = model.cellTitle;
    self.cellSwitchDescripition.text = model.switchTitle;
    [self resetCellStyle:model];
}

- (void)resetCellStyle:(HDEETableCellModel *)cellModel {
    self.cellSwitch.hidden = NO;
    self.cellSwitchDescripition.hidden = NO;
    [self.cellSwitch setOn:cellModel.switchOn animated:NO];
}

- (IBAction)handleSwitchEvent:(UISwitch *)sender {
    if (self.eventBlock) {
        self.eventBlock(sender.on);
    }
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
